﻿using System;
using DevCow.Mashups;

namespace SampleMashup
{
    class Program
    {
        static void Main(string[] args)
        {

            MashupManager mm = new MashupManager(@"C:\Mashup");

            //Get the block from the mashup manager
            MashupBlock bi1 = mm.GetBlock("NameDateArrayBlock2");
            MashupBlock bi2 = mm.GetBlock("BirthdayBlock");

            //Create a new mashup
            Mashup myMashup = new Mashup();

            //add a mashup connection
            MashupBlockConnection conn = myMashup.AddConnection(bi1, "MyArray").AddConnection(bi2, "Birthday");
            conn.AddMapper("name", "NameDateArrayBlock2", "FirstName");
            conn.AddMapper("date", "NameDateArrayBlock2", "Birthdate");

            //execute the mashup
            myMashup.output = Console.Out;
            myMashup.DisplayLineSpace = true;
            myMashup.ExecuteMashup();

            Console.Read();

        }
    }
}
